clear
version 7.0
#delimit ;
cd "Z:\interactionmodels\";                       * SET WORKING DIRECTORY;
log using replication\legislativeparties_replication.log, replace;

*     ***************************************************************** *;
*     ***************************************************************** *;
*       File-Name:      legislativeparties_replication.do               *;
*       Date:           01/09/2007                                      *;
*       Author:         MRG                                             *;
*       Purpose:        Replicate Mozaffar et al. 2003                  *;
*       Input File:     STATA_mozaffar.dta                              *;
*       Output File:    legislativeparties_replication.log              *;
*       Data Output:    none                                            *;
*       Previous file:                                                  *;
*       Machine:                                                        *;
*     ****************************************************************  *;
*     ****************************************************************  *;

set mem 10m;

use getdata\STATA_mozaffar.dta;

*     ****************************************************************  *;
*           Summary Statistics                                          *;
*     ****************************************************************  *;

sum;

*     ****************************************************************  *;
*       First, try to replicate Model 1 in Table 2, page 386.           *;
*     ****************************************************************  *;

regress  legparties logmag10 proximity prox_prescandidate;

regress  legparties logmag proximity prox_prescandidate;

regress  legparties logmag10 proximity prox_prescandidate, robust;

regress  legparties logmag proximity prox_prescandidate, robust;

*     ****************************************************************  *;
*       Neither of these work                                           *;
*     ****************************************************************  *;


*     ****************************************************************  *;
*       Model 2                                                         *;
*     ****************************************************************  *;

regress legparties fragmentation concentration frag_conc;

regress legparties fragmentation concentration frag_conc, robust;

regress legparties fragmentation2 concentration frag_conc;

regress legparties fragmentation2 concentration frag_conc, robust;

regress legparties fragmentation2 concentration frag2_conc;

regress legparties fragmentation2 concentration frag2_conc, robust;

regress legparties fragmentation fragmentation2 concentration frag2_conc, robust;

regress legparties fragmentation fragmentation2 concentration frag_conc, robust;

*     ****************************************************************  *;
*       Could not replicate either, but closest one was with            *;
*       fragmentation2 and frag2_conc.                                  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*       Model 3                                                         *;
*     ****************************************************************  *;

regress legparties logmag10 proximity prox_prescandidate fragmentation concentration frag_conc;

regress legparties logmag10 proximity prox_prescandidate fragmentation concentration frag_conc, robust;

regress legparties logmag proximity prox_prescandidate fragmentation concentration frag_conc;

regress legparties logmag proximity prox_prescandidate fragmentation concentration frag_conc, robust;

regress legparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag_conc;

regress legparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag_conc, robust;

regress legparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc;

regress legparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;

regress legparties logmag proximity prox_prescandidate fragmentation2 concentration frag_conc;

regress legparties logmag proximity prox_prescandidate fragmentation2 concentration frag_conc, robust;

regress legparties logmag proximity prox_prescandidate fragmentation2 concentration frag2_conc;

regress legparties logmag proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;

regress legparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;

*     ****************************************************************  *;
*       Could not replicate - but last equation is closest.             *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               Model 4                                 *;
*     ****************************************************************  *;

regress  legparties logmag10 proximity prox_prescandidate fragmentation concentration logmag10_frag_conc;

regress  legparties logmag10 proximity prox_prescandidate fragmentation concentration logmag10_frag_conc, robust;

regress  legparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag_conc;

regress  legparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag_conc, robust;

regress  legparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag2_conc;

regress  legparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag2_conc, robust;

regress  legparties logmag proximity prox_prescandidate fragmentation concentration logmag_frag_conc;

regress  legparties logmag proximity prox_prescandidate fragmentation concentration logmag_frag_conc, robust;

regress  legparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag_conc;

regress  legparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag_conc, robust;

gen logmag_frag2_conc = logmag*fragmentation2*concentration;
label var logmag_frag2_conc "logmag*fragmentation2*concentration";

regress  legparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag2_conc;

regress  legparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag2_conc, robust;

*     ****************************************************************  *;
*      Again, not possible to replicate despite multiple configurations *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*       These are the specifications that get us the closest to the     *;
*       results shown in Table 1.                                       *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               Model 1                                 *;
*     ****************************************************************  *;

regress legparties logmag10 proximity prox_prescandidate, robust;


*     ****************************************************************  *;
*                               Model 2                                 *;
*     ****************************************************************  *;

regress legparties fragmentation2 concentration frag2_conc, robust;

*     ****************************************************************  *;
*                               Model 3                                 *;
*     ****************************************************************  *;

regress legparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;



*     ****************************************************************  *;
*                               Model 4                                 *;
*     ****************************************************************  *;

regress legparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag2_conc, robust;

*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*                       Correct specifications                          *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               Model 1                                 *;
*     ****************************************************************  *;

regress legparties logmag10 proximity prescandidate prox_prescandidate, robust;

*     ****************************************************************  *;
*                               Model 2                                 *;
*     ****************************************************************  *;

regress legparties fragmentation concentration frag_conc, robust;

*     ****************************************************************  *;
*                               Model 3                                 *;
*     ****************************************************************  *;

regress legparties logmag10 proximity prescandidate prox_prescandidate fragmentation concentration frag_conc, robust;

*     ****************************************************************  *;
*                               Model 4                                 *;
*     ****************************************************************  *;

regress legparties logmag10 proximity prescandidate prox_prescandidate fragmentation concentration
frag_conc logmag10_frag logmag10_conc, robust;

regress legparties logmag10 proximity prescandidate prox_prescandidate fragmentation concentration
frag_conc logmag10_frag logmag10_conc logmag10_frag_conc, robust;


*     ****************************************************************  *;
*                       End of basic replication                        *;
*     ****************************************************************  *;

log close;
exit;
